package de.tum.in.eist.im.client;

import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.TextArea;

import de.tum.in.eist.im.client.domain.Message;

public class Tab {
	AbsolutePanel absolutePanel = new AbsolutePanel();

	TextArea groupMemberText;
	Button addPersonToGroupButton;
	// ((Wrapper Panel for chatLog))
	ScrollPanel chatScrollPanel;
	FlexTable chatLog;
	Button likeButton;

	public Tab(boolean isAllPanel) {
		absolutePanel = new AbsolutePanel();
		absolutePanel.setSize("100%", "367px");

		chatScrollPanel = new ScrollPanel();

		if (!isAllPanel) {
			groupMemberText = new TextArea();
			absolutePanel.add(groupMemberText, 10, 10);
			groupMemberText.setReadOnly(true);
			groupMemberText.setSize("660px", "18px");

			addPersonToGroupButton = new Button("+ person");
			absolutePanel.add(addPersonToGroupButton, 686, 10);
			addPersonToGroupButton.setSize("83px", "28px");

			chatScrollPanel.setSize("759px", "313px");
		} else {
			chatScrollPanel.setSize("759px", "347px");
		}

		chatLog = new FlexTable();
		chatLog.setSize("100%", "100%");

		chatScrollPanel.setWidget(chatLog);

		absolutePanel.add(chatScrollPanel, 10, 10);
	}

	public AbsolutePanel getAbsolutePanel() {
		return absolutePanel;
	}

	public void addMessage(Message m) {

	}

	public Button getaddPersonToGroupButton() {
		return addPersonToGroupButton;
	}
}
